package com.apex.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author XiaoYang
 * @version 1.0
 * @program: springcloud-parant
 * @Classname MySelfRule
 * @description TODO
 * @date 2021/7/15 17:16
 */

@Configuration
public class MySelfRule {
    @Bean
    public IRule myRule(){
        //return new RandomRule();//Ribbon默认是轮询，我们自定义为随机算法
        return new ApexRondomRule();
    }
}
